home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / usr / share / gedit-2 / plugins / snippets / python.xml < prev    next >
Encoding:
Extensible Markup Language  |  2009-04-14  |  2.8 KB  |  113 lines

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <snippets language="Python">
  3.   <snippet id="py">
  4.     <text><![CDATA[#!/usr/bin/env python
  5. #-*- coding:utf-8 -*-
  6.  
  7. $0]]></text>
  8.     <description>#!/usr/bin/env python</description>
  9.     <tag>py</tag>
  10.   </snippet>
  11.   <snippet id="def">
  12.     <text><![CDATA[def ${1:fname}(${2:self}):
  13.     ${3:pass}]]></text>
  14.     <description>New Function</description>
  15.     <tag>def</tag>
  16.   </snippet>
  17.   <snippet id="doc">
  18.     <text><![CDATA["""
  19.     $1
  20. """
  21. $0]]></text>
  22.     <description>doc string</description>
  23.     <tag>doc</tag>
  24.   </snippet>
  25.   <snippet id="get">
  26.     <text><![CDATA[def get$1(self): return self._$1]]></text>
  27.     <description>New Get Method</description>
  28.     <tag>get</tag>
  29.   </snippet>
  30.   <snippet id="class">
  31.     <text><![CDATA[class ${1:ClassName} (${2:object}):
  32.  
  33.     def __init__(self${3:,}):
  34.         ${4:pass}
  35.  
  36. $0]]></text>
  37.     <description>New Class</description>
  38.     <tag>class</tag>
  39.   </snippet>
  40.   <snippet id="for">
  41.     <text><![CDATA[for ${1:i} in ${2:xrange}(${3:count}):
  42.     $0]]></text>
  43.     <description>for loop</description>
  44.     <tag>for</tag>
  45.   </snippet>
  46.   <snippet id="from">
  47.     <text><![CDATA[from $1 import $2
  48. $0]]></text>
  49.     <description>from</description>
  50.     <tag>from</tag>
  51.   </snippet>
  52.   <snippet id="if">
  53.     <text><![CDATA[if ${1:condition}:
  54.     $0]]></text>
  55.     <description>if</description>
  56.     <tag>if</tag>
  57.   </snippet>
  58.   <snippet id="elif">
  59.     <text><![CDATA[elif ${1:condition}:
  60.     $0]]></text>
  61.     <description>elif</description>
  62.     <tag>elif</tag>
  63.   </snippet>
  64.   <snippet id="else">
  65.     <text><![CDATA[else:
  66.     $0]]></text>
  67.     <description>else</description>
  68.     <tag>else</tag>
  69.   </snippet>
  70.   <snippet id="while">
  71.     <text><![CDATA[while ${1:condition}:
  72.     $0]]></text>
  73.     <tag>while</tag>
  74.     <description>while loop</description>
  75.   </snippet>
  76.   <snippet id="insert">
  77.     <text><![CDATA["${1:$GEDIT_SELECTED_TEXT}"]]></text>
  78.     <accelerator><![CDATA[<Control>2]]></accelerator>
  79.     <description>Inside String: Insert "‚Ķ"</description>
  80.   </snippet>
  81.   <snippet id="insert-1">
  82.     <text><![CDATA['${1:$GEDIT_SELECTED_TEXT}']]></text>
  83.     <accelerator><![CDATA[<Control>apostrophe]]></accelerator>
  84.     <description>Inside String: Insert '‚Ķ'</description>
  85.   </snippet>
  86.   <snippet id=".">
  87.     <text><![CDATA[self.]]></text>
  88.     <description>self</description>
  89.     <tag>.</tag>
  90.   </snippet>
  91.   <snippet id="set">
  92.     <text><![CDATA[def set$1(self, ${2:newValue}): self._$1 = $2]]></text>
  93.     <description>New Set Method</description>
  94.     <tag>set</tag>
  95.   </snippet>
  96.   <snippet id="try">
  97.     <text><![CDATA[try:
  98.     $1
  99. except ${2:Error}:
  100.     $0]]></text>
  101.     <tag>try</tag>
  102.     <description>Try... Except</description>
  103.   </snippet>
  104.   <snippet id="main">
  105.     <text><![CDATA[if __name__ == '__main__':
  106.     ${1:sys.exit(main())}
  107.  
  108. $0]]></text>
  109.     <description>main</description>
  110.     <tag>main</tag>
  111.   </snippet>
  112. </snippets>
  113.